package demo.game.chess.common;

public class PieceQueen extends AbstractChessPiece {

	public PieceQueen(final ChessCell initialPosition) {
		super(initialPosition);
	}

	@Override
	protected ChessMove createPieceSpecificMove(final ChessBoard board,
			final ChessCell origin, final ChessCell target)
			throws MoveException {
		if (!origin.isHorizontalAlignWith(target)
				&& !origin.isVerticalAlignWith(target)
				&& !origin.isDiagonalAlignWith(target)) {
			return null;
		}
		checkObstacle(board, origin, target);
		return new ChessMove(origin, target);
	}

	@Override
	public EnumChessPiece getType() {
		return EnumChessPiece.queen;
	}
}
